namespace Registro.Data.RegistroComprasDataContextMigrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Initial : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Encabezado",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        Periodo = c.String(nullable: false),
                        Ruc = c.Long(nullable: false),
                        Razon_Social = c.String(nullable: false),
                        Estado = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            AddColumn("dbo.Base1", "EncabezadoId", c => c.Guid(nullable: false));
            AlterColumn("dbo.Proveedor", "RazonSocial", c => c.String(nullable: false));
            AlterColumn("dbo.Tabla2", "Descripcion", c => c.String(nullable: false));
            AlterColumn("dbo.Tabla10", "Descripcion", c => c.String(nullable: false));
            CreateIndex("dbo.Base1", "EncabezadoId");
            AddForeignKey("dbo.Base1", "EncabezadoId", "dbo.Encabezado", "Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Base1", "EncabezadoId", "dbo.Encabezado");
            DropIndex("dbo.Base1", new[] { "EncabezadoId" });
            AlterColumn("dbo.Tabla10", "Descripcion", c => c.String());
            AlterColumn("dbo.Tabla2", "Descripcion", c => c.String());
            AlterColumn("dbo.Proveedor", "RazonSocial", c => c.String());
            DropColumn("dbo.Base1", "EncabezadoId");
            DropTable("dbo.Encabezado");
        }
    }
}
